-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 8 warning in MediaManager #2472
base: 2.8
Are you sure you want to change the base?
Conversation
I'm not sure that's the right fix. There are multiple checks before that line that files are actually uploaded, including two lines above. So apparently the array does use another key than |
The bug is that the core/system/modules/isotope/library/Isotope/Widget/MediaManager.php Lines 150 to 174 in 8a48dde
|
Did you get that upload error yourself? Can you maybe screenshot what's visible in the back end? In the code it looks like there would be at least 3 error messages for the same thing? |
while you're at it, maybe you can also verify #2468 ? |
EDIT: #2468 precisely describes the problem below, but I only checked it after posting this comment😁 ORIGINAL: I have some new info related to this piece of code, but I am not sure whether it is related to this issue. If filesize of uploaded image is bigger than allowed, than In the screenshot, first message is before the fix is applied, second - after: The system log is empty btw, despite what the message says. The reason is – there is no if ($objUploader->hasError()) {
- $messages = System::getContainer()->get('session')->getFlashBag()->peek('contao_be_error');
+ $messages = System::getContainer()->get('session')->getFlashBag()->peek('contao.BE.error');
if (\is_array($messages)) {
foreach ($messages as $strError) {
$this->addError($strError);
}
}
} |
so fixing the name of the session bag name would make the change in this PR unnecessary? |
No, it would just fix my specific case and #2468. But as far as I understand, in PHP 8 you can't just initialize a variable as a string and then access it as an array later. |
My Sentry reported this: